package baiwa.rta.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import baiwa.rta.dao.KeyCardDao;
import baiwa.rta.dao.TowersDao;
import baiwa.rta.model.DataTableModel;
import baiwa.rta.model.RMactwModel;
import baiwa.rta.model.TowerModel;
import baiwa.rta.service.KeyCardService;

@Service("keyCardServiec")
public class KeyCardServiecImp implements KeyCardService {
	
	@Autowired
	private KeyCardDao keyCardDao;
	
	@Autowired
	private TowersDao towersDao;
	
	@Override
        @Transactional
	public void insert(RMactwModel model) {
		keyCardDao.insert(model);
		
	}

	@Override
        @Transactional
	public void update(RMactwModel model) {
		keyCardDao.update(model);
		
	}

	@Override
        @Transactional
	public void delete(RMactwModel model) {
		keyCardDao.delete(model);
		
	}

	@Override
	public RMactwModel find(String actwid) {
		return keyCardDao.find(actwid);
	}

	@Override
	public TowerModel findRoomId(TowerModel towerModel) {
		return towersDao.findTowerByAddress(towerModel);
	}

	@Override
	public DataTableModel<RMactwModel> getUsersDataTable(RMactwModel model,	int iDisplayStart, int iDisplayLength) {
		return  keyCardDao.getUsersDataTable(model, iDisplayStart, iDisplayLength);
	}


	
	
}
